﻿using System.Runtime.Serialization;

namespace DoubanFM.Model
{
    [DataContract]
    public class Music
    {
        [DataMember(Name = "picture")]
        private string _smallPicture;
        public string SmallPicture
        {
            get { return _smallPicture; }
            set { _smallPicture = value; }
        }

        /// <summary>
        /// Douban.FM return json result contains only small size music covers,
        /// it seems replace the image path will point to the large size picture.
        /// Note: some other apps also Replace("//otho.", "//img3.") which seems not necessary.
        /// </summary>
        public string LargePicture
        {
            get { return _smallPicture.Replace("mpic", "lpic"); }
        }

        [DataMember(Name = "albumtitle")]
        public string AlbumTitle { get; set; }

        [DataMember(Name = "company")]
        public string Company { get; set; }

        [DataMember(Name = "rating_avg")]
        public string Rating { get; set; }

        [DataMember(Name = "public_time")]
        public string PublicTime { get; set; }

        [DataMember(Name = "ssid")]
        public string Ssid { get; set; }

        [DataMember(Name = "album")]
        public string Album { get; set; }

        [DataMember(Name = "like")]
        public bool IsLike { get; set; }

        [DataMember(Name = "artist")]
        public string Artist { get; set; }

        [DataMember(Name = "url")]
        public string Url { get; set; }

        [DataMember(Name = "title")]
        public string Title { get; set; }

        [DataMember(Name = "subtype")]
        public string Subtype { get; set; }

        [DataMember(Name = "length")]
        public long Length { get; set; }

        [DataMember(Name = "sid")]
        public string Sid { get; set; }

        [DataMember(Name = "aid")]
        public string Aid { get; set; }
    }
}
